﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace 继承1
{
    class Program
    {
        static void Main(string[] args)
        {
            Chinese p1 = new Chinese();
            p1.Name = "李小龙";
            p1.SayHello();
            p1.Kufu();

            Object obj = 3;//object是所有类的基类，没有指定父类的类的基类都是object
        }
    }

    class Person
    {
        public string Name
        {
            get;
            set;
        }
        public int age
        {
            set;
            get;
        }

        public void SayHello()
        {
            Console.WriteLine("你好，我叫{0}",Name);
        }
    }

    class Chinese : Person
    {
        public string address
        {
            set;
            get;
        }

        public void Kufu()
        {
            Console.WriteLine("我打！！！！！");
        }
    }
}
